package com.sdx.console.enrollItem.service;

import java.util.List;

import org.beetl.sql.core.engine.PageQuery;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.ibeetl.admin.core.util.PlatformException;

import com.sdx.console.enrollItem.dao.EnrollItemDao;
import com.sdx.console.enrollItem.entity.EnrollItem;
import com.ibeetl.admin.core.service.BaseService;

/**
 * OCR录取 Service
 */

@Service
@Transactional
public class EnrollItemService extends BaseService<EnrollItem>{

    @Resource
	private EnrollItemDao enrollItemDao;

    public PageQuery<EnrollItem>queryByCondition(PageQuery query){
        PageQuery ret =  enrollItemDao.queryByCondition(query);
        queryListAfter(ret.getList());
        return ret;
    }

    public void batchDelEnrollItem(List<String> ids,String userName){
        try {
            enrollItemDao.batchDelEnrollItemByIds(ids,userName);
        } catch (Exception e) {
            throw new PlatformException("批量删除OCR录取失败", e);
        }
    }

	public List<EnrollItem> all() {
		return enrollItemDao.all();
		}
}
